<?php if (!defined ('TYPO3_MODE')) 	die ('Access denied.'); ?>

<br /><hr /><br />

<h2>Example 1: Using a foreach</h2>
<?php if ($this->books): ?>

    <table border="1">

        <tr>
            <th>Title</th>
            <th>Author</th>
        </tr>

        <?php foreach ($this->books as $key => $val): ?>
        <tr>
            <td><?php echo $this->escape($val['title']) ?></td>
            <td><?php echo $this->escape($val['author']) ?></td>
        </tr>
        <?php endforeach; ?>

    </table>

<?php else: ?>

    <p>There are no books to display.</p>

<?php endif; ?>